package com.zj.classwork;
import java.util.Scanner;
public class ClassWork14 {
    public static void main(String[] args) {
        Scanner input=new Scanner(System.in);
        System.out.println("请输入用户名：");
        String username= input.next();
            int count=0;
            while(count<3)
            {
                System.out.println("请输入密码:");
                String value=input.next();
                if("123456".equals(value))
                {
                    System.out.println("请输入金额：");
                    int amount=input.nextInt();
                    if (amount>0&&amount<=1000&&amount%100==0)
                    {
                        System.out.println(amount);
                        System.out.println("交易成功");
                        break;
                    }
                    else {
                        System.out.println("金额错误，请重新输入：");
                        break;
                    }
                }
                else {
                    count++;
                    if(count>=3)
                    {
                        System.out.println(" 请取卡，结束交易");
                    }
                    else
                    {

                        System.out.println("密码错误，重新输入");
                        continue;
                    }

                }
            }





    }


}
